package cn.hxsteel.storage.core.config.dbbasis;

import javax.validation.Validation;
import javax.validation.Validator;
import javax.validation.ValidatorFactory;

import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.ImportResource;

@Configuration
@ImportResource( "classpath:/hibernate.cfg.xml" )
public class HibernateConfig
{
    @Bean
    public Validator validator()
    {
	ValidatorFactory validatorFactory = Validation.buildDefaultValidatorFactory();
	Validator validator = validatorFactory.getValidator();
	return validator;
    }
}